package com.bw.lib_storage.db.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.bw.lib_storage.db.entity.History
@Dao
interface HistoryDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(history: History)

    @Insert
    fun insertAll(vararg history:History)


    @Delete
    fun deleteHistory(history: History)

    @Update
    fun updateHistory(history: History)

    @Query("SELECT * FROM history")
    fun getAllHistory():List<History>

    @Query("SELECT * FROM history WHERE title LIKE '%'+:title+'%'")
    fun getHistoryByTitle(title:String):List<History>
}